/*******************************************************\
|* Author: Trevor Sundberg
\*******************************************************/

// Header protection
#pragma once
#ifndef SKUGO_PACKET_HPP
#define SKUGO_PACKET_HPP

namespace Skugo
{
  namespace PacketType
  {
    enum Enum
    {
      // Marks that a packet type is not valid (this should never be encountered).
      Invalid,
  
      // Initializes the remote client with the project settings (name, etc).
      Initialize,
  
      // The packet's intention is to create a remote plugin.
      Create,

      // The packet's intention is to destroy a remote plugin.
      Destroy,
  
      // The packet is simply a communication between plugins.
      Message,

      // A value was dragged between one plugin to another.
      // It will be recieved on the plugin it gets dropped on,
      // however, the source plugin will be responsible for
      // deserializing the drag drop data into an object on
      // the remote side.
      DragDrop,
    };
  }

  // A packet header consists of all the information that gets sent in the packet
  struct PacketHeader
  {
    // An invalid data size
    static const unsigned InvalidDataSize = 0xFFFFFFFF;

    // The size of the header
    static const unsigned Size = sizeof(unsigned) + sizeof(unsigned char) + sizeof(Guid);

    // The size of the data in the packet (not incling header size)
    unsigned DataSize;

    // Store the type of the packet (basically, what are our intentions)
    unsigned char Type;

    // The unique ID of the plugin (so that we know who its intended for)
    Guid InstanceGuid;
  };
}

// End header protection
#endif
